#include <alibabacloud/oss/OssClient.h>
#include <string>
using namespace AlibabaCloud::OSS;
struct OSSInfo{
    std::string Bucket = "zjc011";
    std::string Endpoint = "oss-cn-beijing.aliyuncs.com";
    std:: string AccessKeyId = "LTAI5t8gYKWyLeiBqbeRbxC7";
    std::string  AccessKeySecret = "FSJtaNe14IlumpeliZB42YAi11Ztcxii";
};
int main(){
    //使用sdk 第一步初始化网络连接  最后释放连接
    //初始化网络连接
    InitializeSdk();
    OSSInfo info;
    ClientConfiguration conf;//用来配置客户端属性（默认属性）
    //创建一个客户端
    OssClient client(info.Endpoint,info.AccessKeyId,info.AccessKeySecret,conf);  
     //文件进行一个上传的操作
     
     std::string filepath = "test.cpp";
     auto outcome=client.PutObject(info.Bucket,"/home/rui/warehouse/1精匠/day8.31"+filepath,filepath); 
    if(outcome.isSuccess())
    {
        fprintf(stderr,"PUtobject fail,code =%s,message = %s,request id = %s\n",outcome.error().Code().c_str(),outcome.error().Message().c_str(),outcome.error().RequestId().c_str());
    }
    
    //释放连接；
    ShutdownSdk();
}